Speculative Staging for Interpreter Optimization

نویسنده

  • Stefan Brunthaler
چکیده

Interpreters have a bad reputation for having lower performance than just-in-time compilers. We present a new way of building high performance interpreters that is particularly effective for executing dynamically typed programming languages. The key idea is to combine speculative staging of optimized interpreter instructions with a novel technique of incrementally and iteratively concerting them at run-time. This paper introduces the concepts behind deriving optimized instructions from existing interpreter instructions— incrementally peeling off layers of complexity. When compiling the interpreter, these optimized derivatives will be compiled along with the original interpreter instructions. Therefore, our technique is portable by construction since it leverages the existing compiler’s backend. At run-time we use instruction substitution from the interpreter’s original and expensive instructions to optimized instruction derivatives to speed up execution. Our technique unites high performance with the simplicity and portability of interpreters—we report that our optimization makes the CPython interpreter up to more than four times faster, where our interpreter closes the gap between and sometimes even outperforms PyPy’s just-in-time compiler. General Terms Design, Languages, Performance

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Speculative Multithreading for Java School of Computer

Automatic parallelization is a compiler and/or runtime optimization that allows single-threaded programs to exploit multiple processors without additional programmer effort. However, although traditional methods can often handle regular and numerical programs, there is no automatically parallelizing compiler or runtime system that works in the general case for irregular and non-numerical progra...

متن کامل

From Interpreter to Compiler using Staging and Monads

In writing this paper we had two goals. First, to promote MetaML, a programming language for writing staged programs, and second, to demonstrate that staging a program can have signi cant bene ts. We do this by example: the derivation of an executable compiler for a small language. We derive the compiler in a rigorous fashion from a semantic description of the language. This is done by staging ...

متن کامل

An Empirical Study on Deoptimization in the Graal Compiler

Managed language platforms such as the Java Virtual Machine or the Common Language Runtime rely on a dynamic compiler to achieve high performance. Besides making optimization decisions based on the actual program execution and the underlying hardware platform, a dynamic compiler is also in an ideal position to perform speculative optimizations. However, these tend to increase the compilation co...

متن کامل

Speculative Optimizations without Fear

Just-in-time (JIT) language implementations make heavy use of speculative optimizations, based on assumptions that might become invalid. This requires the implementation to support a bailout mechanism to undo invalidated optimizations. The interaction between assumptions and optimizations is a major source of complexity for JIT implementers: how should optimizations preserve bailout information...

متن کامل

A Modular XQuery Implementation

CellStore/XQuery is modular a implementation of the XML Query Language interpreter. Primary goal of the implementation is to provide open experimental platform for implementing and testing new query optimization techniques for querying XML data. This paper describes architecture and design features of the implementation as well as possible approaches to extending the interpreter.

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:
  • CoRR

دوره abs/1310.2300  شماره 

صفحات  -

تاریخ انتشار 2013